<?php
class ViewMaterialExpenseAction extends CAction {
	public function run() {
		$expense = null;
		if (isset($_POST['MaterialExpense'])) {
			$expense = new MaterialExpense();
			$expense->attributes = $_POST['MaterialExpense'];
		} elseif (isset($_GET['id'])) {
			$expense = MaterialExpense::model()->findByPk($_GET['id']);
		}
		$this->getController()->render('viewExpense', array(
				'expense' => $expense
			));
	}
}
